/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package com.l2jserver.gameserver.custom;

import com.l2jserver.gameserver.templates.StatsSet;

/**
 * @author Home
 *
 */
public class HonorRankModel implements Cloneable
{
	private static final StatsSet set = new StatsSet();
	static
	{
		set.set("rank_level", 0);
		set.set("stat_points", 0);
		set.set("title_color1", 0x0);
		set.set("title_color2", 0x0);
		set.set("rank_name", "");
		set.set("rank_price", 0);
	}
	public static final HonorRankModel RANK_0 = new HonorRankModel(set);
	private final int _level;
	private final int _points;
	private final int _color1;
	private final int _color2;
	private final int _price;
	private final String _name;
	private final int _itemId;
	private final int _amount;
	
	public HonorRankModel(StatsSet set)
	{
		_level = set.getInteger("rank_level");
		_points = set.getInteger("stat_points");
		_color1 = Integer.decode(set.getString("title_color1"));
		_color2 = Integer.decode(set.getString("title_color2"));
		_price = set.getInteger("rank_price");
		_name = set.getString("rank_name");
		_itemId = set.getInteger("rank_item", -1);
		_amount = set.getInteger("item_amount", -1);
	}
	
	private HonorRankModel(HonorRankModel model)
	{
		_level = model._level;
		_points = model._points;
		_color1 = model._color1;
		_color2 = model._color2;
		_price = model._price;
		_name = model._name;
		_itemId = model._itemId;
		_amount = model._amount;
	}
	
	public String getRankName()
	{
		return _name;
	}
	
	public int getRankItemId()
	{
		return _itemId;
	}
	
	public int getItemAmount()
	{
		return _amount;
	}
	
	public int getRankPrice()
	{
		return _price;
	}
	
	public int getRankLevel()
	{
		return _level;
	}
	
	public int getSpendablePoints()
	{
		return _points;
	}
	
	public int getTitleColor1()
	{
		return _color1;
	}
	
	public int getTitleColor2()
	{
		return _color2;
	}
	
	public HonorRankModel clone()
	{
		return new HonorRankModel(this);
	}
	
}
